import java.util.Scanner;

public class Work2 {
    public static void main(String[] args) {
        System.out.println("书本的价格为12元，你总共有20元");
        System.out.println("1.铅笔的价格为：1元");
        System.out.println("2.橡皮的价格为：2元");
        System.out.println("3.可乐的价格为：3元");
        System.out.println("4.零食的价格为：5元");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        int count = 0;
        int money = 0;
        switch (choice) {
            case 1:
                count = 8 / 1;
                money = 8 - count * choice;
                System.out.println("购买完书本后还可以买铅笔" + count + "个，还剩" + money);
                break;
            case 2:
                count = 8 / 2;
                money = 8 - count * choice;
                System.out.println("购买完书本后还可以买橡皮" + count + "个，还剩" + money);
                break;
            case 3:
                count = 8 / 3;
                money = 8 - count * choice;
                System.out.println("购买完书本后还可以买可乐" + count + "个，还剩" + money);
                break;
            case 4:
                count = 8 / 5;
                money = 8 - count * 5;
                System.out.println("购买完书本后还可以买零食" + count + "个，还剩" + money);
                break;
        }
    }
}